//
//  GHGoodBottomView.m
//  GodHorses
//
//  Created by Mac on 2017/11/18.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "GHGoodBottomView.h"

@implementation GHGoodBottomView
- (instancetype)initWithFrame:(CGRect)frame handle:(void (^)(NSString *))actionHanle{
    if (self == [super initWithFrame:frame]) {
        //0.4 0.6
        STButton * collectionViewButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 0.33333 * UIScreenWidth, 50)
                                                                    title:@"收藏"
                                                               titleColor:GH_firstTextColor
                                                                titleFont:15
                                                             cornerRadius:0
                                                          backgroundColor:[UIColor whiteColor]
                                                          backgroundImage:nil
                                                                    image:[UIImage imageNamed:@"收-藏"]];
        collectionViewButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        [collectionViewButton setClicAction:^(UIButton *sender) {
            if (actionHanle) {
                actionHanle(sender.currentTitle);
            }
        }];
        collectionViewButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
        [collectionViewButton st_showRightLine:50];
        [self addSubview:collectionViewButton];
        STButton * cheButton = [[STButton alloc] initWithFrame:CGRectMake(collectionViewButton.st_right, 0, 0.33333 * UIScreenWidth, 50)
                                                         title:@"购物车"
                                                    titleColor:GH_firstTextColor
                                                     titleFont:15
                                                  cornerRadius:0
                                               backgroundColor:[UIColor whiteColor]
                                               backgroundImage:nil
                                                         image:[UIImage imageNamed:@"gouwuche"]];
        cheButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        [cheButton setClicAction:^(UIButton *sender) {
            if (actionHanle) {
                actionHanle(sender.currentTitle);
            }
        }];
        cheButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
        [self addSubview:cheButton];
        STButton * addButton = [[STButton alloc] initWithFrame:CGRectMake(cheButton.st_right, 0, 0.33333 * UIScreenWidth, 50)
                                                         title:@"加入购物车"
                                                    titleColor:[UIColor whiteColor]
                                                     titleFont:15
                                                  cornerRadius:0
                                               backgroundColor:FlatOrange
                                               backgroundImage:nil
                                                         image:nil];
        addButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        [addButton setClicAction:^(UIButton *sender) {
            if (actionHanle) {
                actionHanle(sender.currentTitle);
            }
        }];
        [addButton st_showRightLine:addButton.st_height];
        [self addSubview:addButton];
        
        STButton * buyButton = [[STButton alloc] initWithFrame:CGRectMake(addButton.st_right , 0, 0.3 * UIScreenWidth , 50)
                                                         title:@"立刻购买"
                                                    titleColor:[UIColor whiteColor]
                                                     titleFont:15
                                                  cornerRadius:0
                                               backgroundColor:FlatOrange
                                               backgroundImage:nil
                                                         image:nil];
        buyButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        [buyButton setClicAction:^(UIButton *sender) {
            if (actionHanle) {
                actionHanle(sender.currentTitle);
            }
        }];
      //  [self addSubview:buyButton];
    }
    return self;
}
#pragma mark --subView
- (void)configSubView{

}
@end
